package com.yanqu.road.entity.guess.emuns;

public enum CommonGuessPlayTypeEnum {

    PLAY_TYPE_TOP_THREE(1, "冠亚军竞猜", 3, 5),
    ;

    private int value;

    private String name;

    private int guessNum;//竞猜数量

    private int rewardItemNum;//奖励项目数量

    CommonGuessPlayTypeEnum(int value, String name, int guessNum, int rewardItemNum) {
        this.value = value;
        this.name = name;
        this.guessNum = guessNum;
        this.rewardItemNum = rewardItemNum;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public int getGuessNum() {
        return guessNum;
    }

    public int getRewardItemNum() {
        return rewardItemNum;
    }

    /**
     * 校验选择的竞猜objId数量是否正确
     * @param playType
     * @param num
     * @return
     */
    public static boolean checkSelectObjIdNum(int playType, int num) {
        for (CommonGuessPlayTypeEnum info : CommonGuessPlayTypeEnum.values()) {
            if (info.getValue() == playType && info.getGuessNum() == num) {
                return true;
            }
        }
        return false;
    }

    /**
     * 获取INFO
     * @param playType
     * @return
     */
    public static CommonGuessPlayTypeEnum getEnumInfo(int playType) {
        for (CommonGuessPlayTypeEnum info : CommonGuessPlayTypeEnum.values()) {
            if (info.getValue() == playType) {
                return info;
            }
        }
        return null;
    }
}
